#!/bin/sh

PATH=/sbin:/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin

mkdir -p /opt/etc/oww -m 755

# Move any existing setup files
if ! test -e /opt/etc/oww/setupNG
then
	if test -e /opt/share/setupNG
	then 
		mv /opt/share/setupNG /opt/etc/oww
	fi
fi

if ! test -e /opt/etc/oww/devices
then
	if test -e /opt/share/devices
	then  
		mv /opt/share/devices /opt/etc/oww
	fi
fi

if ! test -e /opt/etc/oww/stats
then
	if test -e /opt/share/stats
	then  
		mv /opt/share/stats /opt/etc/oww
	fi
fi

echo ; echo
echo "Oww (owwnogui) has been installed."

if ! test -e /opt/etc/oww/devices
then
echo "Set up your devices interactively by running owwnogui -i"
echo "Then quit and run /opt/etc/init.d/S80oww"
else
echo "Devices were already configured."
echo "Go ahead and run /opt/etc/init.d/S80oww"
fi
echo

